// pages/charge/c_reco_detail_2/c_reco_detail_2.js

const app = getApp() // 获取应用实例

Page({

  // 物业缴费明细页面的初始数据
  data: {

    /** 物业费明细数据格式
 * {id:'',name:'',owner_name:'',owner_tel:'',total_area:'',number:'',pay_time:''，}
 */
    detail: {},

  },

  // 请求缴费明细
  reqChargeDetail: function () {
    wx.showLoading({
      title: '加载中..',
      mask: true,
    })
    let that = this;
    let url = app.gl.url + 'index.php/api/house_user/finance_details';
    wx.request({
      url: url,
      data: {
        token: app.gl.token, id: that.data.id,
      },
      method: 'GET',
      success: function (res) {
        wx.hideLoading();
        var data = res.data;
        var code = res.data.code;
        var msg = res.data.msg;
        console.log('请求成功...reqChargeDetail_2...code = ' + code);
        console.log(data);
        // wx.showToast({
        //   title: msg,
        // })
        that.setData({ detail: data.data.data });

      },

      fail: function (res) {
        wx.hideLoading();
        console.log(res);
      },

    })
  },

  // 生命周期函数--监听页面加载
  onLoad: function (options) {
    this.setData({ id: options.id, })

    this.reqChargeDetail();

  },

  // 用户点击右上角分享
  onShareAppMessage: function () {

  }
})